def text_processor(txt):
    print('文本分析报告')
    print(f'原始文本{txt}')
    print(f'文本长度{len(txt)}')
    print(f'单词数量{len(txt.split())}')
    print(f'句子的数量{txt.count('.') + txt.count('!') + txt.count('?')}')
    print(f'句子的大写字母{sum(1 for t in txt if t.isupper())}')
    print(f'句子的小写字母{sum(1 for t in txt if t.islower())}')
    print(f'数字的数量{sum(1 for t in txt if txt.isdigit())}')
    print(f'空格的数量{txt.count(' ')}')
    # 最常用的5个字符
    from collections import Counter
    char_count = Counter(txt.replace(' ', ''))
    print(f'最常用的5个字符{char_count.most_common(5)}')

# char_count: {'a': 1}  Counter({'a': 2, 'b': 2, 'c': 2})
# text_processor('aa bb cc')
sample_text = "Hello World! This is a sample text. It contains 123 numbers and some punctuation!"
text_processor(sample_text)